package com.tencreat.service.mall;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tencreat.common.core.HttpResult;
import com.tencreat.common.core.domain.model.LoginUser;
import com.tencreat.common.core.domain.model.ReqIdParam;
import com.tencreat.common.core.domain.model.ReqIdsParam;
import com.tencreat.domain.mall.MallGoodsCollage;
import com.tencreat.domain.mall.MallGoodsCut;
import com.tencreat.domain.mall.dto.MallGoodsCollageDTO;
import com.tencreat.domain.mall.dto.MallGoodsRecordDTO;
import com.tencreat.domain.mall.vo.*;
import com.tencreat.domain.mall.dto.GoodsCollageListAppDTO;

import java.util.Date;
import java.util.List;

/**
 * 商品拼团Service接口
 *
 * @author tencreat
 * @date 2022-01-24
 */
public interface IMallGoodsCollageService  extends IService<MallGoodsCollage> {
    /**
     * 查询商品拼团
     *
     * @param id 商品拼团ID
     * @return 商品拼团
     */
    public MallGoodsCollageVO selectMallGoodsCollageById(ReqIdParam id);



    /**
     * 查询商品拼团列表
     *
     * @param mallGoodsCollage 商品拼团
     * @return 商品拼团集合
     */
    public List<MallGoodsCollage> selectMallGoodsCollageList(MallGoodsCollage mallGoodsCollage);

    /**
     * 新增商品拼团
     *
     * @param mallGoodsCollage 商品拼团
     * @return 结果
     */
    public int insertMallGoodsCollage(MallGoodsCollage mallGoodsCollage);

    /**
     * 修改商品拼团
     *
     * @param mallGoodsCollage 商品拼团
     * @return 结果
     */
    public int updateMallGoodsCollage(MallGoodsCollage mallGoodsCollage);

    /**
     * 批量删除商品拼团
     *
     * @param ids 需要删除的商品拼团ID
     * @return 结果
     */
    public int deleteMallGoodsCollageByIds(ReqIdsParam ids);

    /**
     * 删除商品拼团信息
     *
     * @param id 商品拼团ID
     * @return 结果
     */
    public int deleteMallGoodsCollageById(ReqIdParam id);

    Page<MallGoodsCollageVO> PCPage(IPage<?> page, MallGoodsCollageDTO dto);

    Page<ResGoodsCollageListAppVO> appPage(Page<ResGoodsCollageListAppVO> page, GoodsCollageListAppDTO vo);

    HttpResult<ResGoodsCollageDetailVO> getGoodsCollageById(ReqIdParam id, LoginUser loginCheck);

    List<ResGoodsCollageListAppVO> getMyCollage(LoginUser loginCheck, Long collageStatus);

    /**
     * 拼团金额统计
     * @return
     */
    MallCollageCountVO collageCount();

    /**
     * 拼团记录
     * @param iPage 分页参数
     * @param dto 条件参数
     * @return
     */
    IPage<MallGoodsCollageRecordVo> collageRecord(IPage<?> iPage, MallGoodsRecordDTO dto);

    boolean reSortOrderReduce(MallGoodsCollage reqIdParam);

    boolean reSortOrderPlus(MallGoodsCollage reqIdParam);
}
